﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Takkou.Server
{
    public static class Proxy
    {
        private const string DATA = 
            "    " +
            "";

        internal static void connectAs(string username, string password)
        {
            // simulate the server connection as username, which will return the initial world state
            string[][] state = connect(username, password);

            // initializes the world according to data got from the server
            // Core.Game.loadWorld(state);
        }

        /**
         * Temporary method to simulate server connection and return the world state
         */
        private static string[][] connect(string username, string password)
        {
            string[][] state = {
                // Each line defines an element in the world, where the first string specifies the element type
                // Different data is required according to the type:
                // World:    name, size (width, height)...
                // Robot:    id, position (x,y), direction,...
                // Resource: id, position (x,y), type, quantity,...
                new string[] { "WORLD", "VIRGO", "400", "300" },
                //new string[] { "RESOURCE", "rsc01", "20", "20", "GOLD", "100" },
                //new string[] { "RESOURCE", "rsc02", "20", "270", "GOLD", "100" },
                //new string[] { "RESOURCE", "rsc03", "370", "20", "GOLD", "100" },
                //new string[] { "RESOURCE", "rsc04", "370", "270", "GOLD", "100" },
                //new string[] { "BASE", "base", "195", "145" },
                //new string[] { "MINER", "fulano", "195", "145", "0" },
                //new string[] { "ROBOT", "cicrano", "195", "145", "90" },
                new string[] { "ROBOT", "beltrano", "195", "145", "180" },
            };
            return state;
        }

        //public static 
    }
}
